package _06finally代码块;

public class Test2 {

    public static void main(String[] args) {
        System.out.println( test() ); //3
    }

    //finally一定会执行
    public static int test(){
        try {
            int[] arr = {};
            System.out.println(arr[0]);
            return 1;
        }catch (Exception e){
            System.out.println("索引越界");
            return 2; //return前，要去执行完finally块
        }finally {
            return 3;
        }
    }



}
